package com.ds.api.controller;

import java.util.ArrayList;

import com.ds.api.utils.message.SmsSingleSender;
import com.ds.api.utils.message.SmsSingleSenderResult;

public class SmsSDKDemo {

    public static void main(String[] args) {
        try {
            //请根据实际 appid 和 appkey 进行开发，以下只作为演示 sdk 使用
            int appid = 1400027642;
            String appkey = "81ed3928fd29214e766bc5f3b6eb8d94";
            
            String phoneNumber1 = "18516000540";
            int tmplId = 18723;

             //初始化单发
            SmsSingleSender singleSender = new SmsSingleSender(appid, appkey);
            SmsSingleSenderResult singleSenderResult;
    
             //普通单发
//            singleSenderResult = singleSender.send(0, "86", phoneNumber1, "您注册的验证码：1234", "", "");
//            System.out.println(singleSenderResult);
    
             //指定模板单发
             //假设短信模板 id 为 1，模板内容为：测试短信，{1}，{2}，{3}，上学。
            ArrayList<String> params = new ArrayList<String>();
            params.add("7859");
//            params.add("深圳");
//            params.add("小明");
            singleSenderResult = singleSender.sendWithParam("86", phoneNumber1, tmplId, params, "", "", "");
            System.out.println(singleSenderResult);
            
            
            
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
